/**
 * @author SY Qin
 */
function grade(obj,oEvent){
	var img1 = 'img/img1.gif';
	var img2 = 'img/img2.gif';
	if(obj.gradeFlag)return;
	var e = oEvent||window.event;
	var target = e.target||e.srcElement;
	var imgArray = obj.getElementsByTagName("img");
				
	for(var i=0;i<imgArray.length;i++){
		imgArray[i]._num = i;
		imgArray[i].onclick=function(){
		if(obj.gradeFlag)return;
		obj.gradeFlag=true;
		alert("评分"+(this._num+1)+"分");
			//this._num+1这个数字写入到数据库中,作为评分的依据
		};
	}
				
	if(target.tagName=="IMG"){
		for(var j=0;j<imgArray.length;j++){
			if(j<=target._num){
				imgArray[j].src = img2;
			}else{
				imgArray[j].src = img1;
			}
		}
	}else{
		for(var k=0; k<imgArray.length;k++){
			imgArray[k].src = img1;
		}
	}
}